#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
using namespace std;

int main() {
    vector <int> v;
    v.push_back(0);
    for(int i=1; i<100; i++) {
        int pos = rand() % v.size();
        v.insert(v.begin() + pos, i);
    }
    copy(v.begin(), v.end(), ostream_iterator<unsigned int>(cout, " ")); cout << endl;

    sort(v.begin(), v.end());
    copy(v.begin(), v.end(), ostream_iterator<unsigned int>(cout, " ")); cout << endl;
    return 0;
}
